package cur.nature.domain.common.conts;

/**
 * 角色代码枚举
 */
public enum RoleCodeEnum {
    ADMIN("admin", "系统管理员"),
    ECMALL_ADMIN("ecmall_admin", "电商系统管理员");

    private String code;
    private String desc;

    RoleCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    // 获取描述
    public static String getByCode(String code) {
        if (code == null) {
            return null;
        }
        for (RoleCodeEnum orderStatus : RoleCodeEnum.values()) {
            if (orderStatus.getCode().equalsIgnoreCase(code)) {
                return orderStatus.getDesc();
            }
        }
        return null;
    }

}


